﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CollectorList.aspx.cs" Inherits="park.Equipment.CollectorList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="Pragma" content="no-cache"/>
    <meta http-equiv="Cache-Control" content="no-cache"/>
    <meta http-equiv="Expires" content="0"/>
    <script src="../load.js?callback=InitList&release=0" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
   <div class="d_topbox">
        <div class="top_search_box">
            <span>所属城区：</span><select id="ddl_City" onchange="CitySelected()"></select><script id="full_City" type="text/x-jquery-tmpl"><option value="${id}">${name}</option></script>
            <span>所属片区：</span><select id="ddl_Area" onchange="AreaSelected()"></select><script id="full_Area" type="text/x-jquery-tmpl"><option value="${id}">${name}</option></script>
            <span>所属街道：</span><select id="ddl_Street"></select><script id="full_Street" type="text/x-jquery-tmpl"><option value="${id}">${name}</option></script>
            <span>名称：</span><input class="text" id="txtName" type="text" />
            <input id="btnSearch" class="btn01_bn" type="button" value="查询" />
        </div>
    </div>
    <div class="table_box">
    <div><input type="button" value="添加" onclick="window.location.replace('CollectorAdd.aspx?add=1');" /></div>
        <table id="tbl_CollectorList" width="90%" border="0" cellspacing="0" cellpadding="0">
            <tr class="td_title">
              <td class="left_bg" align="center">对应关系</td>
              <td align="center">设备编码</td>
              <td align="center">经度</td>
              <td align="center">纬度</td>
              <td align="center">连接方式</td>
              <td align="center">状态</td>              
              <td class="right_bg" colspan="2" align="center">操作</td>
            </tr>
        </table>
        <script id="full_CollectorList" type="text/x-jquery-tmpl">
        {{each(i,v) ListCollector}}
        <tr style="background:{{if i%2==0 }}white{{else}}#ccc{{/if}};" flag1="{{= i }}" flag2="1" flag3="{{= v.first.ID }}">
            <td align="center">{{= v.first.Relationship}}</td>
            <td align="center">${v.first.Code}</td>
            <td align="center">${v.first.Longitude}</td>
            <td align="center">${v.first.Latitude}</td>
            <td align="center">${v.first.Connection}</td>
            <td align="center">${v.first.Enable}</td>
            <td align="center"><input type="button" value="{{= TrBtnName(v.first.Relationship) }}" onclick="SetRelation(this);" /></td>
            <td rowspan="2" align="center"><a href="javascript:Edit('{{= v.first.ID }}','{{= v.second.ID }}');">编辑</a>&nbsp;
                <a href="javascript:Delete('{{= v.first.ID }}','{{= v.second.ID }}');">删除</a>&nbsp;<a href="javascript:Location('{{= v.first.ID }}','{{= v.second.ID }}');">定位</a></td>
        </tr>
        <tr style="background:{{if i%2==0 }}white{{else}}#ccc{{/if}};" flag1="{{= i }}" flag2="2" flag3="{{= v.second.ID }}">
            <td align="center">{{= v.second.Relationship}}</td>
            <td align="center">${v.second.Code}</td>
            <td align="center">${v.second.Longitude}</td>
            <td align="center">${v.second.Latitude}</td>
            <td align="center">${v.second.Connection}</td>
            <td align="center">${v.second.Enable}</td>
            <td align="center"><input type="button" value="{{= TrBtnName(v.second.Relationship) }}" onclick="SetRelation(this);" /></td>
        </tr>
        {{/each}}        
        </script>
       <div id="pager" class="pager" ></div>
       <script id="locationTmpl" type="text/x-jquery-tmpl">
       <div style="width:200px;">
            <p>{{= Relationship }}</p>
            <p>{{= Code }}</p>
            <p>{{= Longitude }}</p>
            <p>{{= Latitude }}</p>
            <p>{{= Connection }}</p>
            <p>{{= Status }}</p>
       </div>
       </script>
    </div>
    </form>
</body>
</html>
